home *** CD-ROM | disk | FTP | other *** search
/ CGI How-To / CGI HOW-TO.iso / chap4 / 4_4 / comp_pl / complete.pl < prev    next >
Encoding:
Perl Script  |  1996-06-15  |  448 b   |  35 lines

  1. #!/usr/bin/perl
  2.  
  3. # Include the cgi library from chapter 1.
  4.  
  5. require "cgilib.pl";
  6.  
  7. # Initialize some variables
  8.  
  9. $data = "";
  10. %cgiDict;
  11. $theUrl = "";
  12.  
  13. #Read the cgi input
  14.  
  15. &readData(*data);
  16. &parseData(*data,*cgiDict);
  17.  
  18. # See which radio button was selected
  19.  
  20. if($cgiDict{"choice"} eq "Yahoo")
  21. {
  22.     $theUrl = "http://www.yahoo.com";
  23. }
  24. else
  25. {
  26.     $theUrl = "http://www.webcrawler.com";
  27. }
  28.  
  29. #Output a complete url
  30.  
  31. print "Location: ",$theUrl,"\n\n";
  32.  
  33. 1;
  34.  
  35.